@import url('https://fonts.googleapis.com/css?family=Playfair+Display&display=swap');
@import url('https://fonts.googleapis.com/css?family=Roboto+Slab:300,400,700&display=swap&subset=latin-ext');

:root {
    --adnote: rgba(128, 174, 253, 0.4);
    --adteorema: rgba(0,0,200, .5);
    --addef: rgba(200, 0, 0, .5);
    --adalgo: rgba(60, 60, 60, 0.4);
    --addemo: rgba(100, 100, 100, 0.4);
    --adcode: #9558b2;
    --adside: rgba(165, 165, 165, 0.5);
    --adnoteright: rgba(120, 120, 120, 0.4);
    --adbackground: rgba(150, 150, 150, .15);
    --adbackgroundlight: rgba(220, 220, 220, 0.15);
    --adejemplo: rgba(0, 200, 0, 0.5);
    --adatencion: rgba(255,145,0,.4);
    --adejercicio: rgb(0, 0, 0);
  }

body#md {
    position: relative;
    /* font-family: "PT Serif", "Roboto Slab", "Helvetica Neue", Helvetica, Arial, sans-serif; */
    text-align: justify;
    margin: 0 auto;
    padding: 0 0px;
    max-width: 70%;
    color: #333;
    font-size: 18px;
    font-weight: 400;
    line-height: 165%;
    overflow-x: hidden;
    text-overflow: ellipses;
    
    /* Mejora de la división de sílabas */
    -webkit-hyphens: auto;
    -moz-hyphens: auto;
    -ms-hyphens: auto;
    hyphens: auto;
    -webkit-hyphenate-limit-before: 3;
    -webkit-hyphenate-limit-after: 2;
    -webkit-hyphenate-limit-lines: 2;
    -webkit-hyphenate-limit-last: always;
    -webkit-hyphenate-limit-zone: 8%;
    hyphenate-limit-chars: 6 3 2;
}

/* División de sílabas para todos los elementos de texto */
.md p, .md li, .md div, .md blockquote, .md td, .md th {
    -webkit-hyphens: auto;
    -moz-hyphens: auto;
    -ms-hyphens: auto;
    hyphens: auto;
    -webkit-hyphenate-limit-before: 3;
    -webkit-hyphenate-limit-after: 2;
    -webkit-hyphenate-limit-lines: 2;
    -webkit-hyphenate-limit-last: always;
    -webkit-hyphenate-limit-zone: 8%;
    hyphenate-limit-chars: 6 3 2;
}

/* if screen is wide enough, put table of contents on the right side */
@media screen and (min-width: 60em) {
	.md .longTOC, .md .mediumTOC, .md .shortTOC {
		max-width: 20%;
		width: 20%; 
		float: right;
		position: fixed;
		right: 0px;
		top: 80px;
	}
}
/* for narrow screens or print, hide table of contents */
@media screen and (max-width: 60em) {
	.md .longTOC { display: none; }
    /*.md .mediumTOC, .md .shortTOC { }*/
	body { max-width: 100%; }
}
@media print {
	.md .longTOC, .md .mediumTOC, .md .shortTOC { display: none; }
	body { max-width: 100%; }
}

.md .longTOC {
    width: 210px;
    display: block;
    border-right: 2px solid #ddd;
    overflow-y:scroll;
    font-size: 15px;
    font-family: inherit;
    background: #FFF;
    
    position: absolute;
    top: 90px;
    left:-190px;
    bottom:0px;
    margin: 0px;
    padding: 0px;
}

.scrolled .md .longTOC {
    position: fixed;
    left: 0px;
    top: 0px;
    border-left: 10px solid #fff; 
}


/* no numbering of headings */
.md h1:before, .md h2:before, .md h3:before, .md h4:before, .md h5:before, .md h6:before { content: none; }

.md .longTOC a {
    color: #000;
}

.md .tocHeader, .md .tocNumber {
    display: none;
}

.md a,
.md div.title, contents, .md .tocHeader,
.md h1, .md h2, .md h3, .md h4, .md h5, .md h6,
.md .nonumberh1, .md .nonumberh2, .md .nonumberh3, .md .nonumberh4, .md .nonumberh5, .md .nonumberh6,
.md .shortTOC, .md .mediumTOC, .md .longTOC {
    font-family: inherit;
}


.md h1, .md h2, .md h3, .md h4 {
    /*font-family: "PT Serif", "Roboto Slab", "Helvetica Neue", Helvetica, Arial, sans-serif;*/
    font-weight: 800;
}

.md h1, .md h2, .md h3, .md h4, .md h5, .md h6 {
    border: none;
}

.md h1 {
    font-size: 18px;
    text-transform: uppercase;
    color: #6aa84f;
    padding-bottom: 8px;
}
.md h2 {
    font-size: 16px;
    text-transform: uppercase;
    color: #6aa84f;
    font-weight: 200;
}
.md h3 {
    font-size: 15px;
    color: #999;
    font-weight: 200;
    font-style: italic;
}



/* Drop caps 
.md p:nth-of-type(3):first-letter {
    font-size: 54px;
    float: left;
    margin-top: .2em;
    margin-right: .07em;
    font-family: "Playfair Display", serif;
}
*/

.md div.title {
    font-family: "Playfair Display", serif;
    text-align: center;
    position: fixed;
    top: -14px;
    left:-0px;
    right: 0px;
    font-weight: 900;
    padding: 10px 10px;
    color: #fff;
    font-size: 45px;
    z-index: 1000;
    background-color: #6aa84f;
    /*background:  linear-gradient(90deg, #6aa84f 0%, #444 90%);*/
    /*border-bottom: 2px solid #ddd;*/
    /*border-right: 10px solid #444;*/  
}


.md div.subtitle {
    margin-top: 10px;
    font-weight: 200;
    font-size: 18px;
    line-height: 120%;
    color: #999;
    text-align: center;
    font-style: italic;
}

.md div.subtitle:nth-of-type(2) {
    margin-top: 100px;
    font-weight: bold;
    font-size: 30px;
    font-style: normal;
    color: #000;
}

.md div.mediumTOC center b {
    display: none;
}

.md div.mediumTOC p {
    margin-top: -16px;
}

.md table.table th{
    color:#FFF;
    background-color:#AAA;
    border:1px solid #888;
    /* top right bottom left */
    padding:5px 15px 5px 15px;
}

.md table.table tr:nth-child(odd) {
  background-color: #DDD;
}

.md table.table td{
    /* top right bottom left */
    padding:5px 15px 5px 15px;
    border:1px solid #888;
    }

/* custom Admonition-style "note", "warn", "def" blocks */
.md .note, .md .warn, .md .def, .md .alg, .md .teorema, .md .note-right, .md .ejemplo, .md .demo, .md .att, .md .code, .md .ejercicio {
    position: relative;
    margin: 1rem 0;
    padding: .4rem 0.8rem;
    border-radius: .2rem;
    break-inside: avoid; 
  }
  
  .md .note {
    border-left: 0.5rem solid var(--adnote);
    background-color: var(--adbackgroundlight);
  }

  .md .note >.admonition-title{
    border-color: var(--adnote);
  }
  
  .md .code {
    border-left: 0.5rem solid var(--adcode);
    background-color: var(--adbackground);
  }

  .md .code{
    padding: 15px 20px;
    padding-bottom: 0 !important;
    margin-bottom: 20px;
  }
  .md .code::before {
    content: "⌨";
    /*content: "⛬";*/
    position: absolute;
    margin-left: 0;
  }

  .md .code::before {
  content: "";
  position: absolute;
  width: 28px;
  height: 28px;
  background-image: url('julia-1.svg');
  background-size: contain;
  background-repeat: no-repeat;
  }

  .md .code >.admonition-title {
    border-color: var(--adcode);
    font-weight: bold;
    padding-left: 3rem; 
  }

  .md .ejercicio {
    border-left: 0.5rem solid var(--adejercicio);
    background-color: var(--adbackground);
    padding: 15px 20px;
    padding-bottom: 5px !important;
    margin-bottom: 20px;
  }

  .md .ejercicio::before {
    content: "📑";
    /*content: "⛬";*/
    position: absolute;
    margin-left: 0;
  }

  .md .ejercicio >.admonition-title {
    border-color: var(--adejercicio);
    font-weight: bold;
    padding-left: 3rem; 
  }

  .md .teorema {
    border-left: 0.5rem solid var(--adteorema);
    background-color: var(--adbackground);
  }
  
  .md .teorema >.admonition-title{
    border-color: var(--adteorema);
  }
  
  .md .att {
    border-left: 0.5rem solid var(--adatencion);
    background-color: var(--adbackground);
  }
  
  .md .att >.admonition-title{
    border-color: var(--adatencion);
  }
  
  .md .note-right {
    position:relative;
    width:fit-content;
    margin-top: 1em;
    margin-bottom: 1em;
    margin-left: auto;
    margin-right: 0;
    padding: .4rem 0.8rem;
    border-radius: .2rem;
    border-left: 0.5rem solid var(--adnoteright);
    background-color: var(--adbackground);
  }
  
  .md .note-right >.admonition-title{
    border-color: var(--adnoteright);
  }
  
  .md .warn {
    border-left: 0.5rem solid rgba(255,145,0,.4);
    background-color: rgba(255,145,0,.15);
  }
  
  .md .def {
    border-left: 0.5rem solid var(--addef);
    background-color: var(--adbackground);
  }
  
  .md .def >.admonition-title{
    border-color: var(--addef);
  }
  
  .md .ejemplo {
    border-left: 0.5rem solid var(--adejemplo);
    background-color: var(--adbackground);
  }
  
  .md .ejemplo >.admonition-title{
    border-color: var(--adejemplo);
  }
  
  .md .alg {
    border-left: 0.5rem solid var(--adalgo);
    background-color: var(--adbackground);
  }
  
  .md .alg >.admonition-title{
    border-color: var(--adalgo);
  }
  
  .md .demo {
    border-left: 0.5rem solid var(--addemo);
    background-color: var(--adbackgroundlight);
  }
  
  .md .demo >.admonition-title{
    border-color: var(--addemo);
  }
  
  .md .side {
    display: inline;
    z-index: 100;
    border-radius: 0px;
    border-left: 1px solid lightgrey;
    /*border-right: 2rem solid rgba(100,100,100,.1);*/
    background-color: white;
    /*border: 1px;*/
    float: right;
    clear: right;
    margin-right: -20%;
    width: 15%;
    margin-top: 0;
    margin-bottom: 0;
    font-size: 0.6rem;
    line-height: 1.2;
    vertical-align: baseline;
    position: relative;
    transition: transform 500ms;
  }
  
  .md .side >.admonition-title{
    border-color: var(--adside);
  }
  
  .md .side:hover{
    /*background-color: rgba(240, 240, 240, 1);*/
    background-color: rgba(240, 240, 240, 1);
    transition: all 1s ease;
    transform: scale(1.5) translateX(-80%);
  }

.md li {
    text-align: justify;
    width: 95%;
}

img {
    margin: 2px 15px 0 15px;
}

/* inline and block code */
.md pre.listing {
	background-color: rgba(0,0,0,.05);
	padding: 0em 1em;
	border-radius: 0.15em;
  width:95%;
}
.md pre.listing code {
	background-color: transparent;
	padding: 0;
	border: none;
}

code:not(pre code) {
    color: blue;
}

.md code > .output { 
  font-weight: bold; 
  border-left: 0.5rem solid rgb(0, 0, 0);
  background: rgba(150, 150, 150, .15); /*#FF7; */
  margin-left: -20px; 
  padding-left: 20px}

.md div.mediumTOC {
  position: fixed;
  border-left: 1.1rem solid rgba(180, 180, 180);
	border-radius:3px;
  font-size: 14px;
  line-height: 135%;
  left: -1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 350px; /* Ancho completo del TOC */
  height: auto;
  background: rgba(240, 240, 240); /* Color de fondo del TOC */
  overflow: hidden;
  clip-path: inset(0 95% 0 0); /* Oculta el TOC parcialmente a la derecha */
  transition: clip-path 0.3s ease;
  z-index: 1000;
}

.md div.mediumTOC:hover {
  clip-path: inset(0 0 0 0); /* Muestra el TOC completo al hacer hover */
}

.md div.mediumTOC .toc-content {
  padding: 10px;
  width: 100%;
  height: 100%;
}

/*summary {
  list-style-type: '⭳ ';
} 

details[open] > summary {
  list-style-type: '⭱ ';
}

details .details-content {
            max-height: 0;
            overflow: hidden;
            padding: 0 1.5rem;
            opacity: 0;
            transition: 
                max-height 0.4s ease-out,
                padding 0.4s ease-out,
                opacity 0.3s ease-out;
        }

details[open] .details-content {
            max-height: 800px;
            padding: 1rem 1.5rem 1.5rem;
            opacity: 1;
        }
            */

details { 
  margin: 1rem 0; 
  border-radius: 8px; 
  overflow: hidden; 
  /*box-shadow: 0 2px 8px rgba(0,0,0,0.1); */
} 
details::details-content { 
  max-height: 0; 
  overflow: auto;
  padding: 0 1.5rem; 
  opacity: 0; 
  transition: max-height 0.4s ease-out, padding 0.4s ease-out, opacity 0.3s ease-out; 
} 
details[open]::details-content { 
  max-height: 400px; /* Ajustar según contenido */ 
  padding: 1rem 1rem 1rem; 
  opacity: 1; 
}

/* Tabs styles */
/* Hide the radio inputs */
.md .tabs input[type="radio"] {
    display: none;
}

/* Container setup */
.md .tabs {
    position: relative;
    padding-top: 40px; /* Space for the tabs */
}

/* Style the labels (tabs) - position them absolutely at the top */
.md .tabs label {
    cursor: pointer;
    display: inline-block;
    margin-right: .2rem;
    padding: .5rem 1rem;
    background-color: hsl(0, 0%, 94%);
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    position: absolute;
    top: 0;
    z-index: 2;
}

/* Position each label horizontally */
.md .tabs label:nth-of-type(1) { left: 0; }
.md .tabs label:nth-of-type(2) { left: 120px; }
.md .tabs label:nth-of-type(3) { left: 240px; }
.md .tabs label:nth-of-type(4) { left: 360px; }
.md .tabs label:nth-of-type(5) { left: 480px; }
.md .tabs label:nth-of-type(6) { left: 600px; }
.md .tabs label:nth-of-type(7) { left: 720px; }

/* All content sections occupy the same space */
.md .tabs .tab-content {
    display: none;
    padding: 1rem;
    border: 1px solid #ddd;
    background-color: white;
    position: absolute;
    top: 2.5em; /* Just below the tabs */
    left: 0;
    right: 0;
    z-index: 1;
    min-height: 100px; /* Altura mínima en lugar de fija */
}

/* Display content when its corresponding radio is checked */
.md .tabs input[type="radio"]:checked + label + .tab-content {
    display: block;
    position: relative; /* Cambia a relativo para que ocupe su altura natural */
    top: 0;
}

/* Style the active tab label */
.md .tabs input[type="radio"]:checked + label {
    background-color: white;
    border-bottom: 1px solid white;
    font-weight: bold;
    z-index: 3;
}

/* Ajustar el contenedor para que se expanda con el contenido */
.md .tabs {
    position: relative;
    padding-top: 2.5em; /* Space for the tabs */
    min-height: 150px; /* Altura mínima del sistema completo */
}

/* Eliminar la altura fija del after */
.md .tabs::after {
    content: "";
    display: block;
    clear: both;
    /* Sin altura fija - se expande automáticamente */
}